module.exports = function () {
  var config = {
    presets: [['react-app', {
      absoluteRuntime: false
    }]],
    plugins: [['use-const-enum', {
      importRegStr: 'choerodon-ui/.*/enum'
    }], ['import', {
      libraryName: 'antd',
      style: false
    }, 'ant'], ['import', {
      libraryName: 'choerodon-ui',
      style: false
    }, 'c7n'], ['import', {
      libraryName: 'choerodon-ui/pro',
      style: false
    }, 'c7n-pro'], ['@babel/plugin-proposal-decorators', {
      legacy: true
    }], 'lodash', ['@babel/plugin-proposal-class-properties', {
      loose: true
    }], process.env.DISABLE_AUTO_CSS_MODULES !== 'true' && [require.resolve('@umijs/babel-plugin-auto-css-modules'), {
      flag: 'modules'
    }]].filter(Boolean)
  };

  if (process.env.MULTIPLE_SKIN_ENABLE === 'true') {
    var _require = require('@cpaas-front-ui/cfg/lib/utils/uedConfig'),
        generateC7nUiConfig = _require.generateC7nUiConfig,
        generateCpaasUIConfig = _require.generateCpaasUIConfig;

    config.plugins = generateCpaasUIConfig().concat(generateC7nUiConfig()).concat(config.plugins.filter( // @ts-ignore
    function () {
      var arrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
      return !['ant', 'c7n', 'c7n-pro'].includes(arrs[2]);
    }));
  }

  return config;
};
